package top.gokzzz.mock.api;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.gokzzz.common.utils.ServletUtil;
import top.gokzzz.covert.Mapper;
import top.gokzzz.covert.UserMapperConverter;
import top.gokzzz.covert.test.entity.User;
import top.gokzzz.covert.test.entity.UserDto;
import top.gokzzz.log.annotation.ApiLog;

import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;

@RestController
@RequestMapping("/test")
public class TestApi {

    @ApiLog("測試")
    @PostMapping("/{id}")
    public boolean test(HttpServletRequest request, @PathVariable String id, @RequestBody User user) {

        return true;
    }

    @ApiLog("測試")
    @GetMapping("/2/{id}")
    public boolean test2(HttpServletRequest request, @PathVariable String id) {
        ArrayList<Object> objects = new ArrayList<>();
        Object o = objects.get(2);
        return true;
    }
}
